package com.example.lsh_smartnotes

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.baway.common.view.BaseMvvmActivity
import com.example.lib_common.custom.CircleCountDownView
import com.example.login.LoginActivity
import com.example.lsh_smartnotes.databinding.ActivitySplashBinding
import com.example.main.MainActivity

class SplashActivity : BaseMvvmActivity<ActivitySplashBinding>() {
    override fun getLayoutID(): Int = R.layout.activity_splash

    override fun initViews() {
        super.initViews()
        mDataBinding.countDownView.setCountDownListener(object : CircleCountDownView.CountDownListener{
            override fun onCountDownFinished() {
                startActivity(Intent(this@SplashActivity ,LoginActivity::class.java))
            }

        })

        // 开始倒计时
        mDataBinding.countDownView.startCountDown()

        // 点击跳过
        mDataBinding.countDownView.setOnClickListener {
            mDataBinding.countDownView.stopCountDown()
            startActivity(Intent(this@SplashActivity ,LoginActivity::class.java))
        }
    }
}